package com.hymjweb.demo.hymj.native_bill_manage.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.hymjweb.demo.framework.util.pojoContrast.FieldMeta;
import com.hymjweb.demo.hymj.native_bill_manage.other_charges.bean.BNativeBillOtherCharges;
import lombok.Data;
import lombok.ToString;

import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
import java.util.List;


@Table(name = "b_native_bill")
@Data
@ToString
public class BNativeBillPojo implements Serializable,Comparable<BNativeBillPojo>,Cloneable {

    @FieldMeta(columnname = "id", name = "分单ID", comment = "分单ID,就是分单号,开单员手动输入,要校验是否重复")
    private String id;

    @FieldMeta(columnname = "attribution_department_id", name = "分单归属部门ID", comment = "分单归属部门ID")
    private String attributionDepartmentId;

    @FieldMeta(columnname = "transport_species_id", name = "运输种类ID", comment = "运输种类ID,关联xt_dic.id key=XT_DIC_TRANSPORT_SPECIES")
    private Long transportSpeciesId;

    @FieldMeta(columnname = "transport_way_id", name = "承运方式ID", comment = "承运方式ID,关联xt_dic.id key=XT_DIC_TRANSPORT_WAY")
    private Long transportWayId;

    @FieldMeta(columnname = "transport_scope_id", name = "运输范围ID", comment = "运输范围ID,关联xt_dic.id key=XT_DIC_TRANSPORT_SCOPE")
    private Long transportScopeId;

    @FieldMeta(columnname = "city_id", name = "营业部所在城市ID", comment = "营业部所在城市ID,关联xt_city.id")
    private String cityId;

    @FieldMeta(columnname = "dest_city_id", name = "目的市ID", comment = "目的市ID,做为提货点的检索条件,关联xt_city.id")
    private String destCityId;

    @FieldMeta(columnname = "delivery_customer_id", name = "发货客户ID", comment = "发货客户ID,关联b_customer.id")
    private String deliveryCustomerId;

    @FieldMeta(columnname = "delivery_customer_name", name = "发货客户名称", comment = "发货客户名称")
    private String deliveryCustomerName;

    @FieldMeta(columnname = "delivery_customer_phone", name = "发货客户电话", comment = "发货客户电话")
    private String deliveryCustomerPhone;

    @FieldMeta(columnname = "delivery_customer_address", name = "发货客户地址", comment = "发货客户地址")
    private String deliveryCustomerAddress;

    @FieldMeta(columnname = "delivery_customer_contact_id", name = "发货客户联人ID", comment = "发货客户联人ID,关联b_customer_contact.id")
    private String deliveryCustomerContactId;

    @FieldMeta(columnname = "delivery_customer_contact_name", name = "发货客户联人名称", comment = "发货客户联人名称")
    private String deliveryCustomerContactName;

    @FieldMeta(columnname = "delivery_customer_contact_phone", name = "发货客户联人电话", comment = "发货客户联人电话")
    private String deliveryCustomerContactPhone;

    @FieldMeta(columnname = "receive_customer_name", name = "收货客户名称", comment = "收货客户名称")
    private String receiveCustomerName;

    @FieldMeta(columnname = "receive_customer_phone", name = "收货客户电话", comment = "收货客户电话")
    private String receiveCustomerPhone;

    @FieldMeta(columnname = "receive_customer_address", name = "收货客户地址", comment = "收货客户地址")
    private String receiveCustomerAddress;

    @FieldMeta(columnname = "pick_up_point_id", name = "提货点ID", comment = "提货点ID,关联xt_pick_up_point.id,该字段可以为空")
    private String pickUpPointId;

    @FieldMeta(columnname = "pick_up_point_name", name = "提货点名称", comment = "提货点名称,检索提货点的过滤条件是根据目的市,如果目的市没有填写给出提示")
    private String pickUpPointName;

    @FieldMeta(columnname = "pick_up_point_phone", name = "提货点电话", comment = "提货点电话")
    private String pickUpPointPhone;

    @FieldMeta(columnname = "pick_up_point_address", name = "提货点地址", comment = "提货点地址")
    private String pickUpPointAddress;

    @FieldMeta(columnname = "pick_up_goods_way_id", name = "提货方式ID", comment = "提货方式ID,关联xt_dic.id key=XT_DIC_PICK_UP_GOODS_WAY")
    private Long pickUpGoodsWayId;

    @FieldMeta(columnname = "sign_choose_id", name = "签收方式ID", comment = "签收方式ID,关联xt_dic.id key=XT_DIC_SIGN_CHOOSE")
    private Long signChooseId;

    @FieldMeta(columnname = "delivery_customer_saleman_id", name = "发货客户业务员ID", comment = "发货客户业务员ID,关联xt_user.id")
    private String deliveryCustomerSalemanId;

    @FieldMeta(columnname = "airport_id", name = "始发机场ID", comment = "始发机场ID,关联xt_airport.id")
    private String airportId;

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @FieldMeta(columnname = "flight_date", name = "班次日期", comment = "班次日期")
    private Date flightDate;

    @FieldMeta(columnname = "flight_no", name = "班次号", comment = "班次号,关联b_flight.id")
    private String flightNo;

    @FieldMeta(columnname = "flight_name", name = "班次号名称", comment = "班次号名称")
    private String flightName;

    @FieldMeta(columnname = "airlines_id", name = "航空公司ID", comment = "班次号对应的航空公司ID,关联xt_airlines.id")
    private String airlinesId;

    @FieldMeta(columnname = "plan_take_off_time", name = "计划出发时间", comment = "计划出发时间,对应b_flight_date.plan_take_off_time")
    private String planTakeOffTime;

    @FieldMeta(columnname = "goods_name", name = "货物名称", comment = "货物名称")
    private String goodsName;

    @FieldMeta(columnname = "goods_type_id", name = "货物类型ID", comment = "货物类型ID,关联xt_dic.id key=XT_DIC_GOODS_TYPE")
    private Long goodsTypeId;

    @FieldMeta(columnname = "packing_way_id", name = "包装方式ID", comment = "包装方式ID,关联xt_dic.id key=XT_DIC_PACKING_WAY")
    private Long packingWayId;

    @FieldMeta(columnname = "volume_information", name = "体积信息", comment = "体积信息,根据页面填写信息自动生成，格式为[{长:xx,宽:xx,高:xx},...]")
    private String volumeInformation;

    @FieldMeta(columnname = "total_number", name = "总件数", comment = "总件数,由页面填写的信息累计计算得出(可手动直接调整)")
    private Integer totalNumber;

    @FieldMeta(columnname = "actual_weight", name = "实际重量", comment = "实际重量,由页面填写的信息累计计算得出(可手动直接调整)")
    private Double actualWeight;

    @FieldMeta(columnname = "chargeable_weight", name = "计费重量", comment = "计费重量,由页面填写的信息累计计算得出(可手动直接调整)")
    private Double chargeableWeight;

    @FieldMeta(columnname = "weight_rate", name = "重量费率", comment = "重量费率,根据选择的客户,自动从客户表中自动带出")
    private Double weightRate;

    @FieldMeta(columnname = "volume", name = "体积", comment = "体积,体积由页面填写的信息累计计算得出(可手动直接调整)")
    private Double volume;

    @FieldMeta(columnname = "volume_rate", name = "体积费率", comment = "体积费率,根据选择的客户,自动从客户表中自动带出")
    private Double volumeRate;

    @FieldMeta(columnname = "ticket_price", name = "起票价", comment = "起票价")
    private Double ticketPrice;

    @FieldMeta(columnname = "transport_cost", name = "运费合计", comment = "运费合计,运费合计=计费重量*重量费率>体积*体积费率?计费重量*重量费率:体积*体积费率")
    private Double transportCost;

    @FieldMeta(columnname = "declared_value", name = "声明价值", comment = "声明价值,默认填写2500")
    private Double declaredValue;

    @FieldMeta(columnname = "insurance_rate", name = "保费费率", comment = "保费费率,根据发货客户ID,运输种类,自动带出")
    private Double insuranceRate;

    @FieldMeta(columnname = "insurance_fee", name = "保费", comment = "保费,保费=声明价值*保费费率")
    private Double insuranceFee;

    @FieldMeta(columnname = "open_bill_delivery_charge", name = "开单送货费", comment = "开单送货费,公司收取送货给客户的费用")
    private Double openBillDeliveryCharge;

    @FieldMeta(columnname = "agent_delivery_charge", name = "代理送货费", comment = "代理送货费,公司付给货物目的地代理点的派送费用")
    private Double agentDeliveryCharge;

    @FieldMeta(columnname = "delivery_charge_comment", name = "送货费备注", comment = "送货费备注")
    private String deliveryChargeComment;

    @FieldMeta(columnname = "agent_delivery_charge_account_check_status_id", name = "代理送货费对账状态ID", comment = "代理送货费对账状态ID,关联xt_dic.id key=XT_DIC_ACCOUNT_CHECK_STATUS")
    private Long agentDeliveryChargeAccountCheckStatusId;

    @FieldMeta(columnname = "pickup_driver_fee", name = "发货方司机提货费用", comment = "发货方司机提货费用")
    private Long pickupDriverFee;

    @FieldMeta(columnname = "pickup_driver_name", name = "发货方提货司机姓名", comment = "发货方提货司机姓名")
    private String pickupDriverName;

    @FieldMeta(columnname = "tax", name = "税金", comment = "税金")
    private Double tax;

    @FieldMeta(columnname = "fuel_surcharge", name = "燃油费", comment = "燃油费")
    private Double fuelSurcharge;

    @FieldMeta(columnname = "collection_money", name = "代收款", comment = "代收款")
    private Double collectionMoney;


    private List<BNativeBillOtherCharges> otherChargeList;

    @FieldMeta(columnname = "other_charges", name = "其他费用", comment = "其他费用")
    private Double otherCharges;

    @FieldMeta(columnname = "other_charges_comment", name = "其他费用说明", comment = "其他费用说明")
    private String otherChargesComment;

    @FieldMeta(columnname = "service_charge", name = "业务费", comment = "业务费")
    private Double serviceCharge;

    @FieldMeta(columnname = "actual_transport_cost", name = "实收运费", comment = "实收运费")
    private Double actualTransportCost;

    @FieldMeta(columnname = "business_cost_allocation_id", name = "摊业务费用ID", comment = "是否分摊业务费用ID,关联xt_dic.id key=XT_DIC_YES_NO")
    private Long businessCostAllocationId;

    @FieldMeta(columnname = "business_cost_allocation_type_id", name = "分摊类型ID", comment = "业务费分摊类型ID,关联xt_dic.id key=XT_DIC_BUSINESS_COST_ALLOCATION_TYPE")
    private Long businessCostAllocationTypeId;

    @FieldMeta(columnname = "business_cost_comment", name = "业务费备注", comment = "业务费备注")
    private String businessCostComment;

    @FieldMeta(columnname = "print_actual_weight", name = "打单实际重量", comment = "打单实际重量")
    private Double printActualWeight;

    @FieldMeta(columnname = "print_chargeable_weight", name = "打单计费重量", comment = "打单计费重量")
    private Double printChargeableWeight;

    @FieldMeta(columnname = "print_weight_rate", name = "打单重量费率", comment = "打单重量费率")
    private Double printWeightRate;

    @FieldMeta(columnname = "print_volume", name = "打单体积", comment = "打单体积")
    private Double printVolume;

    @FieldMeta(columnname = "print_volume_rate", name = "打单体积费率", comment = "打单体积费率")
    private Double printVolumeRate;

    @FieldMeta(columnname = "inner_operation_charge", name = "内部操作费", comment = "内部操作费=分单的计费重量 * 0.2元/公斤(开单时默认填0，由操作设置模块选择后再计算得出，注意单价在页面上提供输入，不能直接固定为0.2)")
    private Double innerOperationCharge;

    @FieldMeta(columnname = "delivery_customer_payment_method_id", name = "发货客户付款方式ID", comment = "发货客户付款方式ID,关联xt_dic.id key=XT_DIC_DELIVERY_CUSTOMER_PAYMENT_METHOD")
    private Long deliveryCustomerPaymentMethodId;

    @FieldMeta(columnname = "delivery_customer_payment_amount", name = "发货客户付款金额", comment = "发货客户付款金额,发货人付款金额默认等于总金额")
    private Double deliveryCustomerPaymentAmount;

    @FieldMeta(columnname = "receive_customer_payment_method_id", name = "收货客户付款方式ID", comment = "收货客户付款方式ID,关联xt_dic.id key=XT_DIC_RECEIVE_CUSTOMER_PAYMENT_METHOD")
    private Long receiveCustomerPaymentMethodId;

    @FieldMeta(columnname = "receive_customer_payment_amount", name = "收货客户付款金额", comment = "收货客户付款金额")
    private Double receiveCustomerPaymentAmount;

    @FieldMeta(columnname = "total_amount", name = "总金额", comment = "总金额,总金额=实收运费+业务费+代收款+保费+开单送货费+税金+燃油费+其他费用")
    private Double totalAmount;

    @FieldMeta(columnname = "actual_amount", name = "实收金额", comment = "实收金额,实收金额=总金额-代收款-业务费")
    private Double actualAmount;

    @FieldMeta(columnname = "cashier_id", name = "收银员ID", comment = "收银员ID,关联xt_user.id")
    private String cashierId;

    @FieldMeta(columnname = "open_bill_user_id", name = "开单人ID", comment = "开单人ID")
    private String openBillUserId;

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @FieldMeta(columnname = "open_bill_date", name = "开单日期", comment = "开单日期")
    private Date openBillDate;

    @FieldMeta(columnname = "open_bill_department_id", name = "开单部门ID", comment = "开单部门ID,关联xt_department.id")
    private String openBillDepartmentId;

    @FieldMeta(columnname = "roll_call_department_id", name = "点到部门ID", comment = "点到部门ID,初始默认与点到部门ID一致,关联xt_department.id")
    private String rollCallDepartmentId;

    @FieldMeta(columnname = "comment", name = "备注", comment = "备注")
    private String comment;

    @FieldMeta(columnname = "bill_load_status_id", name = "分单配载状态ID", comment = "分单配载状态ID,关联xt_dic.id key=XT_DIC_BILL_LOAD_STATUS")
    private Long billLoadStatusId;

    @FieldMeta(columnname = "bill_load_master_bill_ids", name = "主单号IDS", comment = "主单号IDS,如果多个主单号格式为mid1,mid2,单个主单号格式为mid1")
    private String billLoadMasterBillIds;

    @FieldMeta(columnname = "business_cost_status_id", name = "业务费状态ID", comment = "业务费状态ID,关联xt_dic.id key=XT_DIC_SETTLEMENT_STATUS")
    private Long businessCostStatusId;

    @FieldMeta(columnname = "agent_delivery_charge_status_id", name = "代理送货费状态ID", comment = "代理送货费状态ID,关联xt_dic.id key=XT_DIC_SETTLEMENT_STATUS")
    private Long agentDeliveryChargeStatusId;

    @FieldMeta(columnname = "arrears_status_id", name = "分单欠款状态ID", comment = "分单欠款状态ID,关联xt_dic.id key=XT_DIC_SETTLEMENT_STATUS")
    private Long arrearsStatusId;

    @FieldMeta(columnname = "drop_status_id", name = "拉货状态ID", comment = "拉货状态ID,关联xt_dic.id key='XT_DIC_DROP_STATUS',用于标识该分单是否拉过货")
    private Long dropStatusId;

    @FieldMeta(columnname = "settlement_status_id", name = "分单结算状态", comment = "分单结算状态,关联xt_dic.id key='XT_DIC_SETTLEMENT_STATUS', 分单结算的前提是已经全部配载，已经对账，如果是结算完成，则该分单不能再做任何信息调整")
    private Long settlementStatusId;

    @FieldMeta(columnname = "cancel_status_id", name = "分单作废状态ID", comment = "分单作废状态ID,关联xt_dic.id key='XT_DIC_CANCEL_STATUS' 分单未配载时可以作废，如果有配载则不能作废")
    private Long cancelStatusId;

    @FieldMeta(columnname = "account_check_status_id", name = "分单对账状态ID", comment = "分单对账状态ID,关联xt_dic.id key='XT_DIC_ACCOUNT_CHECK_STATUS' 对账完成的前提是分单全部配载，分单对账后才能做结算")
    private Long accountCheckStatusId;

    @FieldMeta(columnname = "refund_number", name = "拉货退货件数", comment = "分单拉货时退客户件数,默认是0,配载时要把这个值去再进行配载'")
    private Integer refundNumber;

    @FieldMeta(columnname = "refund_actual_weight", name = "拉货退货实重", comment = "分单拉货时退客户实际重量,默认是0,配载时要把这个值去再进行配载")
    private Double refundActualWeight;

    @FieldMeta(columnname = "refund_chargeable_weight", name = "拉货退货计重", comment = "分单拉货时退客户计费重量,默认是0,配载时要把这个值去再进行配载")
    private Double refundChargeableWeight;

    @FieldMeta(columnname = "refund_volume", name = "拉货退货体积", comment = "分单拉货时退客户体积,默认是0,配载时要把这个值去再进行配载")
    private Double refundVolume;

    @FieldMeta(columnname = "drop_amount", name = "调整金额", comment = "调整金额，默认为0，如果不为0，则表示用于记录该分单拉货表中所有对应该分单调整金额之和")
    private Double dropAmount;

    @FieldMeta(columnname = "settlement_amount", name = "结算金额", comment = "结算金额 = 实收金额 + 调整金额")
    private Double settlementAmount;

    @FieldMeta(columnname = "share_cost", name = "分摊成本", comment = "分摊成本,该分单对应的主单中按计费重量进行分摊的成本,分计算公式,单对应主单总金额 x 分单计重 / 主单计重")
    private Double shareCost;

    @FieldMeta(columnname = "share_cost_comment", name = "分摊成本说明", comment = "分摊成本说明")
    private String shareCostComment;

    @FieldMeta(columnname = "operating_cost", name = "操作费", comment = "操作费,锦添操作费(这个操作费还没有定，要给出解决方案),默认填0")
    private Double operatingCost;

    @FieldMeta(columnname = "gross_profit", name = "毛利润", comment = "毛利润=分单结算金额(settlement_amount) - 业务费(service_charge) - 代理送货费(agent_delivery_charge) - 分单分摊成本(share_cost)-提货费(pickup_driver_fee)-锦添操作费(operating_cost这个操作费还没有定，要给出解决方案,现在不考虑)")
    private Double grossProfit;

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @FieldMeta(columnname = "create_time", name = "创建时间", comment = "创建时间")
    private Date createTime;

    @FieldMeta(columnname = "create_user_id", name = "创建用户ID", comment = "创建用户ID")
    private String createUserId;

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @FieldMeta(columnname = "update_time", name = "更新时间", comment = "更新时间")
    private Date updateTime;

    @FieldMeta(columnname = "update_user_id", name = "更新用户ID", comment = "更新用户ID")
    private String updateUserId;


    @Override
    public int compareTo(BNativeBillPojo o) {
        if(this.settlementAmount.doubleValue() < o.getSettlementAmount().doubleValue()){
            return -1;
        }
        else if(this.settlementAmount.doubleValue() == o.getSettlementAmount().doubleValue()){
            return 0;
        }
        else{
            return 1;
        }
    }


    /**
     * 用于对象 clone
     * @return
     * @throws CloneNotSupportedException
     */
    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

/**
 * create table b_native_bill
 * (
 * 	id varchar(20) not null comment '分单ID,就是分单号,开单员手动输入,要校验是否重复'
 * 		primary key,
 * 	transport_species_id bigint null comment '运输种类ID,关联xt_dic.id key=''XT_DIC_TRANSPORT_SPECIES''',
 * 	transport_way_id bigint null comment '承运方式ID,关联xt_dic.id key=''XT_DIC_TRANSPORT_WAY''',
 * 	transport_scope_id bigint null comment '运输范围ID,关联xt_dic.id key=''XT_DIC_TRANSPORT_SCOPE''',
 * 	city_id varchar(20) null comment '营业部所在城市ID,关联xt_city.id',
 * 	dest_city_id varchar(20) null comment '目的市ID,关联xt_city.id,做为提货点的检索条件',
 * 	delivery_customer_id varchar(20) null comment '发货客户ID,关联b_customer.id',
 * 	delivery_customer_name varchar(100) null comment '发货客户名称',
 * 	delivery_customer_phone varchar(20) null comment '发货客户电话',
 * 	delivery_customer_address varchar(200) null comment '发货客户地址',
 * 	delivery_customer_contact_id varchar(20) null comment '发货客户联人ID,关联b_customer_contact.id',
 * 	delivery_customer_contact_name varchar(50) null comment '发货客户联人名称',
 * 	delivery_customer_contact_phone varchar(20) null comment '发货客户联人电话',
 * 	receive_customer_name varchar(100) null comment '收货客户名称',
 * 	receive_customer_phone varchar(20) null comment '收货客户电话',
 * 	receive_customer_address varchar(200) null comment '收货客户地址',
 * 	pick_up_point_id varchar(20) null comment '提货点ID,关联xt_pick_up_point.id,该字段可以为空',
 * 	pick_up_point_name varchar(100) null comment '提货点名称,检索提货点的过滤条件是根据目的市,如果目的市没有填写给出提示',
 * 	pick_up_point_phone varchar(200) null comment '提货点电话',
 * 	pick_up_point_address varchar(200) null comment '提货点地址',
 * 	pick_up_goods_way_id bigint null comment '提货方式ID,关联xt_dic.id key=''XT_DIC_PICK_UP_GOODS_WAY''',
 * 	sign_choose_id bigint null comment '签收方式ID,关联xt_dic.id key=''XT_DIC_SIGN_CHOOSE''',
 * 	delivery_customer_saleman_id varchar(20) null comment '发货客户业务员ID,关联xt_user.id',
 * 	airport_id varchar(20) null comment '始发机场ID,关联xt_airport.id',
 * 	flight_date datetime null comment '班次日期',
 * 	flight_no varchar(20) null comment '班次号,关联b_flight.id,空运时不能为空，汽运时为空',
 * 	flight_name varchar(100) null comment '班次名称，类似于MU1233或苏B123',
 * 	airlines_id varchar(20) null comment '班次号对应的航空公司ID,关联xt_airlines.id',
 * 	plan_take_off_time varchar(20) null comment '计划出发时间,对应b_flight_date.plan_take_off_time',
 * 	goods_name varchar(100) null comment '货物名称',
 * 	goods_type_id bigint null comment '货物类型ID,关联xt_dic.id key="XT_DIC_GOODS_TYPE"',
 * 	packing_way_id bigint null comment '包装方式ID,关联xt_dic.id key=''XT_DIC_PACKING_WAY''',
 * 	volume_information varchar(2000) null comment '体积信息,根据页面填写信息自动生成，格式为[{长:xx,宽:xx,高:xx},...]',
 * 	total_number int null comment '总件数,由页面填写的信息累计计算得出(可手动直接调整)',
 * 	actual_weight decimal(10,2) null comment '实际重量,由页面填写的信息累计计算得出(可手动直接调整)',
 * 	chargeable_weight decimal(10,2) null comment '计费重量,由页面填写的信息累计计算得出(可手动直接调整)',
 * 	weight_rate decimal(10,2) null comment '重量费率,根据选择的客户,自动从客户表中自动带出',
 * 	volume decimal(10,2) null comment '体积,体积由页面填写的信息累计计算得出(可手动直接调整)',
 * 	volume_rate decimal(10,2) null comment '体积费率,根据选择的客户,自动从客户表中自动带出',
 * 	ticket_price decimal(10,2) null comment '起票价',
 * 	transport_cost decimal(10,2) null comment '运费合计,运费合计=计费重量*重量费率>体积*体积费率?计费重量*重量费率:体积*体积费率',
 * 	declared_value decimal(10,2) null comment '声明价值,默认填写2500',
 * 	insurance_rate decimal(10,2) null comment '保费费率,根据发货客户ID,运输种类,自动带出',
 * 	insurance_fee decimal(10,2) null comment '保费,保费=声明价值*保费费率',
 * 	open_bill_delivery_charge decimal(10,2) null comment '开单送货费,公司收取送货给客户的费用',
 * 	agent_delivery_charge decimal(10,2) null comment '代理送货费,公司付给货物目的地代理点的派送费用',
 * 	delivery_charge_comment varchar(1000) null comment '送货费备注',
 * 	tax decimal(10,2) null comment '税金',
 * 	fuel_surcharge decimal(10,2) null comment '燃油费',
 * 	collection_money decimal(10,2) null comment '代收款',
 * 	other_charges decimal(10,2) null comment '其他费用',
 * 	other_charges_comment varchar(2000) null comment '其他费用说明',
 * 	service_charge decimal(10,2) null comment '业务费',
 * 	actual_transport_cost decimal(10,2) null comment '实收运费,实收运费=运费合计-业务费',
 * 	business_cost_allocation_id bigint null comment '是否分摊业务费用ID,关联xt_dic.id key=''XT_DIC_YES_NO''',
 * 	business_cost_allocation_type_id bigint null comment '业务费分摊类型ID,关联xt_dic.id key=''XT_DIC_BUSINESS_COST_ALLOCATION_TYPE''',
 * 	business_cost_comment varchar(2000) null comment '业务费备注',
 * 	print_actual_weight decimal(10,2) null comment '打单实际重量',
 * 	print_chargeable_weight decimal(10,2) null comment '打单计费重量',
 * 	print_weight_rate decimal(10,2) null comment '打单重量费率',
 * 	print_volume decimal(10,2) null comment '打单体积',
 * 	print_volume_rate decimal(10,2) null comment '打单体积费率',
 * 	inner_operation_charge decimal(10,2) null comment '内部操作费=分单的计费重量 * 0.2元/公斤(开单时默认填0，由操作设置模块选择后再计算得出，注意单价在页面上提供输入，不能直接固定为0.2)',
 * 	delivery_customer_payment_method_id bigint null comment '发货客户付款方式ID,关联xt_dic.id key=''XT_DIC_DELIVERY_CUSTOMER_PAYMENT_METHOD''',
 * 	delivery_customer_payment_amount decimal(10,2) null comment '发货客户付款金额,发货人付款金额默认等于总金额',
 * 	receive_customer_payment_method_id bigint null comment '收货客户付款方式ID,关联xt_dic.id key=''XT_DIC_RECEIVE_CUSTOMER_PAYMENT_METHOD''',
 * 	receive_customer_payment_amount decimal(10,2) null comment '收货客户付款金额',
 * 	total_amount decimal(10,2) null comment '总金额,总金额=实收运费+业务费+代收款+保费+开单送货费+税金+燃油费+其他费用',
 * 	actual_amount decimal(10,2) null comment '实收金额,实收金额=总金额-代收款-业务费',
 * 	drop_amount decimal(10,2) null comment '调整金额，默认为0，如果不为0，则表示用于记录该分单拉货表中所有对应该分单调整金额之和',
 * 	settlement_amount decimal(10,2) null comment '结算金额 = 实收金额 + 调整金额',
 * 	cashier_id varchar(20) null comment '收银员ID,关联xt_user.id',
 * 	operating_cost decimal(10,2) null comment '操作费,锦添操作费(这个操作费还没有定，要给出解决方案),默认填0',
 * 	gross_profit decimal(10,2) null comment '毛利润,总金额-业务费-结算送货费-该分单对应的主单中按计费重量进行分摊的成本-锦添操作费(这个操作费还没有定，要给出解决方案)',
 * 	share_cost decimal(10,2) null comment '分摊成本,该分单对应的主单中按计费重量进行分摊的成本,分计算公式,单对应主单总金额 x 分单计重 / 主单计重',
 * 	open_bill_user_id varchar(20) null comment '开单人ID',
 * 	open_bill_date datetime null comment '开单日期',
 * 	open_bill_department_id varchar(20) null comment '开单部门ID,关联xt_department.id',
 * 	roll_call_department_id varchar(20) null comment '点到部门ID,初始默认与点到部门ID一致,关联xt_department.id',
 * 	comment varchar(2000) null comment '备注',
 * 	bill_load_status_id bigint null comment '分单配载状态，关联xt_dic.id key=''XT_DIC_BILL_LOAD_STATUS''',
 * 	business_cost_status_id bigint null comment '业务费状态ID,关联xt_dic.id key=''XT_DIC_SETTLEMENT_STATUS''',
 * 	agent_delivery_charge_status_id bigint null comment '代理送货费状态ID,关联xt_dic.id key=''XT_DIC_SETTLEMENT_STATUS''',
 * 	arrears_status_id bigint null comment '分单欠款状态ID,关联xt_dic.id key=''XT_DIC_SETTLEMENT_STATUS''',
 * 	drop_status_id bigint null comment '拉货状态ID,关联xt_dic.id key=''XT_DIC_DROP_STATUS'',用于标识该主单是否拉过货，',
 * 	settlement_status_id bigint null comment '分单结算状态,关联xt_dic.id key=''XT_DIC_SETTLEMENT_STATUS'',如果是结算完成，则该分单不能再做任何信息调整',
 * 	cancel_status_id bigint null comment '分单作废状态ID,关联xt_dic.id key=''XT_DIC_CANCEL_STATUS'' 分单未配载时可以作废，如果有配载则不能作废',
 * 	account_check_status_id bigint null comment '分单对账状态ID,关联xt_dic.id key=''XT_DIC_ACCOUNT_CHECK_STATUS'' 对账完成的前提是分单全部配载，分单对账后才能做结算',
 * 	refund_number int null comment '分单拉货时退客户件数,默认是0,配载时要把这个值去再进行配载',
 * 	refund_actual_weight decimal(10,2) null comment '分单拉货时退客户实际重量,默认是0,配载时要把这个值去再进行配载',
 * 	refund_chargeable_weight decimal(10,2) null comment '分单拉货时退客户计费重量,默认是0,配载时要把这个值去再进行配载',
 * 	refund_volume decimal(10,2) null comment '分单拉货时退客户体积,默认是0,配载时要把这个值去再进行配载',
 * 	create_time datetime null comment '创建时间',
 * 	create_user_id varchar(50) null comment '创建用户ID',
 * 	update_time datetime null comment '更新时间',
 * 	update_user_id varchar(50) null comment '更新用户ID',
 * 	constraint FK_B_NATIVE_BILL_CALL_DEPARTMENT
 * 		foreign key (roll_call_department_id) references xt_department (id),
 * 	constraint FK_B_NATIVE_BILL_CUSTOMER
 * 		foreign key (delivery_customer_id) references b_customer (id),
 * 	constraint FK_B_NATIVE_BILL_OPEN_DEPARTMENT
 * 		foreign key (open_bill_department_id) references xt_department (id)
 * )
 * comment '分单表,存储开单部门开具的原始货运单(非航空公司主单)';
 *
 * create index FK_B_NATIVE_BILL_PICK_UP_POINT
 * 	on b_native_bill (pick_up_point_id);
 */
